<html>
<head>
    <title>update</title>
</head>
<body>
<div style="width: 800px">
    <form id="forms" class="form-horizontal" role="form">
        <input type="hidden" th:value="${r.rid}" name="rid">
        <div class="form-group">
            <label for="a" class="col-sm-2 control-label">旅游地风景:</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" id="a" placeholder="请输入旅游地风景" name="rname" th:value="${r.rname}" >
            </div>
        </div>
        <div class="form-group">
            <label for="b" class="col-sm-2 control-label">旅游地价格:</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" id="b" placeholder="请输入旅游地价格" name="price" th:value="${r.price}" >
            </div>
        </div>
        <div class="form-group">
            <label for="c" class="col-sm-2 control-label">旅游地简介:</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" id="c" placeholder="请输入旅游地简介"
                       name="routeintroduce" th:value="${r.routeintroduce}" >
            </div>
        </div>
        <div class="form-group">
            <label for="d" class="col-sm-2 control-label">上架时间:</label>
            <div class="col-sm-4">
                <input type="date" class="form-control" id="d" placeholder="请输入上架时间" name="rdate" th:value="${#dates.format(r.rdate,'yyyy-MM-dd')}" >
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">是否是旅游主题:</label>
            <div class="col-sm-4">
                是:<input type="radio" name="isthemetour" value="0"  th:checked="${r.isthemetour == 0}"> &nbsp&nbsp&nbsp
                否:<input type="radio" name="isthemetour" value="1"  th:checked="${r.isthemetour == 1}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">旅游线路分类:</label>
            <div class="col-sm-3">
                <div class="form-group">
                    <select class="form-control" name="cid" id="cid">
                            <th:block th:each="c : ${TabCategory}">
                                <option th:value="${c.cid}" th:selected="${r.cid == c.cid}"><span th:text="${c.cname}"></span></option>
                            </th:block>
                    </select>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label for="g" class="col-sm-2 control-label">旅游地址风景图:</label>
            <div class="col-sm-6">
                <input type="text" class="form-control" id="g" placeholder="旅游地址风景图" name="rimage" th:value="${r.rimage}">
                <input type="file" id="newsImg" name="myFile" multiple/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">旅游线路分类:</label>
            <div class="col-sm-3">
                <div class="form-group">
                    <select class="form-control" name="sid" id="sid">
                            <th:block th:each="s : ${TabSeller}">
                                <option th:value="${s.sid}" th:selected="${r.sid == s.sid}"><span th:text="${s.sname}"></span></option>
                            </th:block>
                    </select>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label for="h" class="col-sm-2 control-label">数据的来源id:</label>
            <div class="col-sm-4">
                <input type="text" class="form-control" id="h" placeholder="请输入抓取数据的来源id" name="sourceid" th:value="${r.sourceid}" >
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">
    $('#newsImg').fileinput({
        language: 'zh',
        uploadUrl: '/file/upLoadFile',
        enctype: "multipart/form-data",
        browseClass: 'btn btn-primary',
        initialPreviewAsData: true,
        initialPreviewFileType: "image",
        initialPreview: "/file/download?filename=[[${r.rimage}]]"
    });
    $('#newsImg').on("fileuploaded", function (event, data, previewId, index) {
        $("#g").val(data.response.imgUrl);
    });
</script>
</body>
</html>
